<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="按钮" onclick="fn2('诸葛亮',22)">
<script>
    function fn1() {
        alert("这是无参无返回值方法!")
    }
    fn1();
    function fn2(name,age) {
        alert(name+':'+age)
    }
    fn2('tom',20)
    function fn3(name,age) {
        return name+":"+age
    }
    let result=fn3('tom',21)
    alert(result)
    function fn4(name,age) {
        alert(name+':'+age)
    }
    fn4('tom',22)
    let fn5=function (name,age) {
        alert(name+':'+age)
    }
    fn5('tom',23)
    let fn6=new Function('name','age','alert(name+":"+age)')
    fn6('tom',24)
</script>
</body>
</html>